package hcn.protocol.brandnew.dengji.bingli;

import com.fasterxml.jackson.annotation.JsonFormat;
import ctd.util.xml.jaxb.DateAdapter;
import ctd.util.xml.jaxb.DateTimeAdapter;
import lombok.Data;

import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.util.Date;
import java.util.List;


/**
 * 全院住院记录查询-响应消息(成功) - ODS_03120004_SUC
 *
 * @author enjoyLife
 */
@Data
@XmlRootElement(name = "Data")
@XmlAccessorType(XmlAccessType.FIELD)
public class QueryInpatientRecordResponse {

    /**
     * 总条数
     */
    @XmlElement(name = "Total")
    private String total;
    /**
     * 住院记录集合
     */
    @XmlElementWrapper(name = "Records")
    @XmlElement(name = "Record")
    private List<Record> records;

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class DiagList {

        /**
         * 诊断业务类型
         */
        @XmlElement(name = "DiagnosisServiceType")
        private String diagnosisServiceType;
        /**
         * 诊断类型
         */
        @XmlElement(name = "DiagnosisType")
        private Byte diagnosisType;
        /**
         * 主诊标记
         */
        @XmlElement(name = "MainDiagnosisMark")
        private Byte mainDiagnosisMark;
        /**
         * 诊断时间
         */
        @XmlElement(name = "DiagnosisTime")
        @XmlJavaTypeAdapter(DateTimeAdapter.class)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date diagnosisTime;
        /**
         * 诊断id
         */
        @XmlElement(name = "DiagnoseId")
        private String diagnoseId;
        /**
         * 诊断编码
         */
        @XmlElement(name = "DiagnoseCode")
        private String diagnoseCode;
        /**
         * 诊断名称
         */
        @XmlElement(name = "DiagnoseName")
        private String diagnoseName;
    }

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Record {

        /**
         * 就诊医疗机构组织机构代码
         */
        @XmlElement(name = "VisitOrganization")
        private String visitOrganization;
        /**
         * 就诊机构名称
         */
        @XmlElement(name = "VisitOrganizationName")
        private String visitOrganizationName;
        /**
         * 住院号
         */
        @XmlElement(name = "VisitId")
        private String visitId;
        /**
         * 住院号码
         */
        @XmlElement(name = "HospizationId")
        private String hospizationId;
        /**
         * 病案号码
         */
        @XmlElement(name = "MedicalRecordNumber")
        private String medicalRecordNumber;
        /**
         * 业务系统患者档案ID
         */
        @XmlElement(name = "SourcePatientId")
        private String sourcePatientId;
        /**
         * 患者姓名
         */
        @XmlElement(name = "Name")
        private String name;
        /**
         * 性别代码
         */
        @XmlElement(name = "Sex")
        private String sex;
        /**
         * 出生日期
         */
        @XmlElement(name = "BirthDate")
        @XmlJavaTypeAdapter(DateAdapter.class)
        @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
        private Date birthDate;
        /**
         * 年龄（岁）
         */
        @XmlElement(name = "Age")
        private Short age;
        /**
         * 患者电话号码
         */
        @XmlElement(name = "ContactNo")
        private String contactNo;
        /**
         * 身份证件类别代码
         */
        @XmlElement(name = "IdCardCode")
        private String idCardCode;
        /**
         * 身份证件号码
         */
        @XmlElement(name = "IdCard")
        private String idCard;
        /**
         * 就诊卡类别代码
         */
        @XmlElement(name = "MedicalCardType")
        private String medicalCardType;
        /**
         * 就诊卡号
         */
        @XmlElement(name = "MedicalCardId")
        private String medicalCardId;
        /**
         * 病人科室代码(报告)
         */
        @XmlElement(name = "DeptCode")
        private String deptCode;
        /**
         * 病人科室名称
         */
        @XmlElement(name = "DeptName")
        private String deptName;
        /**
         * 住院次数
         */
        @XmlElement(name = "HospitalizationTimes")
        private Short hospitalizationTimes;
        /**
         * 医生编码
         */
        @XmlElement(name = "DoctorId")
        private String doctorId;
        /**
         * 医生姓名
         */
        @XmlElement(name = "DoctorName")
        private String doctorName;
        /**
         * 病区代码
         */
        @XmlElement(name = "AttendingDoctorId")
        private String attendingDoctorId;
        /**
         * 病区名称
         */
        @XmlElement(name = "AttendingDoctorName")
        private String attendingDoctorName;
        /**
         * 入院时间
         */
        @XmlElement(name = "AdmissionTime")
        @XmlJavaTypeAdapter(DateTimeAdapter.class)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date admissionTime;
        /**
         * 出院时间
         */
        @XmlElement(name = "DischargeTime")
        @XmlJavaTypeAdapter(DateTimeAdapter.class)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date dischargeTime;
        /**
         * 护理级别
         */
        @XmlElement(name = "CareLevel")
        private Byte careLevel;
        /**
         * 离院方式
         */
        @XmlElement(name = "LeavingHospitalMode")
        private String leavingHospitalMode;
        /**
         * 诊断集合
         */
        @XmlElementWrapper(name = "DiagLists")
        @XmlElement(name = "DiagList")
        private List<DiagList> diagLists;
    }

}
